package com.LachesismStorm.lachesism.member.controller;

import com.LachesismStorm.lachesism.core.common.response.ResponsePage;
import com.LachesismStorm.lachesism.core.common.response.ResponseResult;
import com.LachesismStorm.lachesism.core.util.LachesismTools;
import com.LachesismStorm.lachesism.member.service.LuntaiService;
import com.LachesismStorm.lachesism.member.vo.*;
import com.LachesismStorm.lachesism.member.vo.dto.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;

/**
 * @Author lachesism
 * @Date 2024-04-10 16:05
 **/
@RestController
@Api(tags = "luntai")
@RequestMapping("/luntai")
public class LuntaiController {
    @Resource
    private LuntaiService luntaiService;

    @ApiOperation(value = "添加车辆信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiUserCar", value = "车辆信息")
    })
    @PostMapping("/addCarInfo")
    public ResponseResult addCarInfo(@RequestBody LuntaiUserCar car) {
        Integer carId = luntaiService.addCarInfo(car);
        return ResponseResult.success(carId, "添加成功");
    }

    @ApiOperation(value = "获取车辆信息")
    @PostMapping("/getCars")
    public ResponseResult getCars() {
        List<UserCarsDto> cars = luntaiService.getCars();
        return ResponseResult.success(cars, "查找成功");
    }

    @ApiOperation(value = "修改车辆信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiUserCar", value = "车辆信息")
    })
    @PostMapping("/updateCar")
    public ResponseResult updateCar(@RequestBody LuntaiUserCar car) {
        luntaiService.updateCar(car);
        return ResponseResult.success(null, "修改成功");
    }

    @ApiOperation(value = "添加轮胎信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiUserTyre", value = "轮胎信息")
    })
    @PostMapping("/addTyreInfo")
    public ResponseResult addTyreInfo(@RequestBody LuntaiUserTyre tyre) {
        Integer id = luntaiService.addTyreInfo(tyre);
        return ResponseResult.success(id, "添加成功");
    }

    @ApiOperation(value = "修改轮胎信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiUserTyre", value = "轮胎信息")
    })
    @PostMapping("/updateTyreInfo")
    public ResponseResult updateTyreInfo(@RequestBody LuntaiUserTyre tyre) {
        luntaiService.updateTyreInfo(tyre);
        return ResponseResult.success(null, "修改成功");
    }

    @ApiOperation(value = "获取轮胎信息By车辆id")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "carId", value = "车id")
    })
    @PostMapping("/getTyreInfoByCarId")
    public ResponseResult getTyreInfoByCarId(@RequestParam Integer carId) {
        List<LuntaiUserTyre> tyres = luntaiService.getTyreInfoByCarId(carId);
        return ResponseResult.success(tyres, "查询成功");
    }

    @ApiOperation(value = "获取轮胎品牌")
    @PostMapping("/getTyreBrand")
    public ResponseResult getTyreBrand() {
        List<LuntaiTyre> brand = luntaiService.getTyreBrand();
        return ResponseResult.success(brand, "查询成功");
    }

    @ApiOperation(value = "提交延保/鼓包申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiPolicyExtensionRequest", value = "申请内容")
    })
    @PostMapping("/policyExtensionRequest")
    public ResponseResult policyExtensionRequest(@RequestBody LuntaiPolicyExtensionRequest request) {
        luntaiService.policyExtensionRequest(request);
        return ResponseResult.success(null, "提交成功");
    }

    @ApiOperation(value = "修改延保/鼓包申请信息,不可修改申请类型")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiPolicyExtensionRequest", value = "修改申请内容")
    })
    @PostMapping("/editPolicyExtensionRequest")
    public ResponseResult editPolicyExtensionRequest(@RequestBody LuntaiPolicyExtensionRequest request) {
        luntaiService.editPolicyExtensionRequest(request);
        return ResponseResult.success(null, "修改成功");
    }

    @ApiOperation(value = "根据状态获取延保/鼓包申请列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "status", value = "状态")
    })
    @PostMapping("/getPolicyExtensionRequestList")
    public ResponseResult getPolicyExtensionRequestList(@RequestParam Integer status) {
        List<PolicyExtensionRequestDto> request = luntaiService.getPolicyExtensionRequestList(status);
        return ResponseResult.success(request, "查询成功");
    }

    @ApiOperation(value = "查看延保/鼓包信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "requestId", value = "申请id")
    })
    @PostMapping("/getPolicyExtensionRequestInfo")
    public ResponseResult getPolicyExtensionRequestInfo(@RequestParam Integer requestId) {
        PolicyExtensionRequestInfoDto requestInfo = luntaiService.getPolicyExtensionRequestInfo(requestId);
        return ResponseResult.success(requestInfo, "查询成功");
    }

    @ApiOperation(value = "查找店铺信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiStore", value = "店铺信息")
    })
    @PostMapping("/getStore")
    public ResponseResult getStoreList(@RequestBody LuntaiStore store) {
        List<LuntaiStore> storeList = luntaiService.getStoreList(store);
        return ResponseResult.success(storeList, "查询成功");
    }

    @ApiOperation(value = "获取所有区域")
    @PostMapping("/getAllArea")
    public ResponseResult geAllArea() {
        List<AreaList> areaList = luntaiService.geAllArea();
        return ResponseResult.success(areaList, "查询成功");
    }

    @ApiOperation(value = "查看消息")
    @PostMapping("/getMessageList")
    public ResponseResult getMessageList() {
        List<LuntaiMessage> messageList = luntaiService.getMessageList();
        return ResponseResult.success(messageList, "查询成功");
    }

    @ApiOperation(value = "编辑消息（已读/删除）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiMessage", value = "消息修改内容")
    })
    @PostMapping("/editMessage")
    public ResponseResult editMessage(@RequestBody LuntaiMessage message) {
        luntaiService.editMessage(message);
        return ResponseResult.success(null, "修改成功");
    }

    @ApiOperation(value = "获取所有文本模板：介绍，关于这些")
    @PostMapping("/getAllIntroduce")
    public ResponseResult getAllIntroduce() {
        List<LuntaiIntroduce> introduceList = luntaiService.getAllIntroduce();
        return ResponseResult.success(introduceList, "查询成功");
    }

    @ApiOperation(value = "查看我的优惠券")
    @PostMapping("/getCoupons")
    public ResponseResult getCoupons() {
        List<LuntaiCoupons> couponsList = luntaiService.getCoupons();
        return ResponseResult.success(couponsList, "查询成功");
    }

    @ApiOperation(value = "查看新闻列表")
    @PostMapping("/getNews")
    public ResponseResult getNews() {
        List<LuntaiNews> news = luntaiService.getNews();
        return ResponseResult.success(news, "查询成功");
    }

    @ApiOperation(value = "查看新闻详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "newsId", value = "新闻id")
    })
    @PostMapping("/getNewsInfo")
    public ResponseResult getNewsInfo(@RequestParam Integer newsId) {
        LuntaiNews news = luntaiService.getNewsInfo(newsId);
        return ResponseResult.success(news, "查询成功");
    }

    @ApiOperation(value = "申请救援")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiRescueApplication", value = "救援内容信息")
    })
    @PostMapping("/rescueApplication")
    public ResponseResult rescueApplication(@RequestBody LuntaiRescueApplication application) {
        luntaiService.rescueApplication(application);
        return ResponseResult.success(null, "提交成功");
    }

    @ApiOperation(value = "修改救援申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiRescueApplication", value = "救援内容信息")
    })
    @PostMapping("/editRescueApplication")
    public ResponseResult editRescueApplication(@RequestBody LuntaiRescueApplication application) {
        luntaiService.editRescueApplication(application);
        return ResponseResult.success(null, "提交成功");
    }

    @ApiOperation(value = "查看救援列表根据状态查询")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "status", value = "类型")
    })
    @PostMapping("/getRescueApplicationList")
    public ResponseResult getRescueApplicationList(@RequestParam Integer status) {
        List<LuntaiRescueApplicationDto> applicationList = luntaiService.getRescueApplicationList(status);
        return ResponseResult.success(applicationList, "提交成功");
    }

    @ApiOperation(value = "查看救援详情信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "applicationId", value = "申请id")
    })
    @PostMapping("/getRescueApplicationInfoById")
    public ResponseResult getRescueApplicationInfoById(@RequestParam Integer applicationId) {
        RescueApplicationDto application = luntaiService.getRescueApplicationInfoById(applicationId);
        return ResponseResult.success(application, "查询成功");
    }

    @ApiOperation(value = "查看车辆概括信息")
    @PostMapping("/getCarSummarizeInformation")
    public ResponseResult getCarSummarizeInformation(@RequestBody UserCarsDto dto) {
        List<CarsListDto> carsListDtoList = luntaiService.getCarSummarizeInformation(dto);
        return ResponseResult.success(carsListDtoList, "查询成功");
    }

    @ApiOperation(value = "门店申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiStoreApplication", value = "申请信息")
    })
    @PostMapping("/storeApplication")
    public ResponseResult getCarSummarizeInformation(@RequestBody LuntaiStoreApplication application) {
        luntaiService.storeApplication(application);
        return ResponseResult.success(null, "已提交");
    }

    @ApiOperation(value = "查看门店申请列表")
    @PostMapping("/getStoreApplicationList")
    public ResponseResult getStoreApplicationList() {
        List<LuntaiStoreApplication> storeApplicationList = luntaiService.getStoreApplicationList();
        return ResponseResult.success(storeApplicationList, "查询成功");
    }

    @ApiOperation(value = "获取救援类型列表")
    @PostMapping("/getRescueTypeList")
    public ResponseResult getRescueTypeList() {
        List<LuntaiRescueType> rescueTypeList = luntaiService.getRescueTypeList();
        return ResponseResult.success(rescueTypeList, "查询成功");
    }

    @ApiOperation(value = "上传图片")
    @PostMapping("/uploadPic")
    public ResponseResult getHundredPic(@RequestParam("file") MultipartFile file) {
        String url = luntaiService.uploadPic(file);
        return ResponseResult.success(url);
    }


    @ApiOperation(value = "根据车辆id查询车轮胎")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "carId", value = "车辆id")
    })
    @PostMapping("/getTyreListByCarId")
    public ResponseResult getTyreByCarId(@RequestParam Integer carId) {
        List<LuntaiUserTyre> tyreList = luntaiService.getTyreListByCarId(carId);
        return ResponseResult.success(tyreList, "查询成功");
    }

    @ApiOperation(value = "查看是否提交审核")
    @PostMapping("/checkIsApplyStore")
    public ResponseResult checkIsApplyStore() {
        Boolean result = luntaiService.checkIsApplyStore();
        return ResponseResult.success(result, "查询成功");
    }

    @ApiOperation(value = "查看门店申请审核结果")
    @PostMapping("/getStoreApplyResult")
    public ResponseResult getStoreApplyResult() {
        List<LuntaiStoreApplication> result = luntaiService.getStoreApplyResult();
        return ResponseResult.success(result, "查询成功");
    }

    @ApiOperation(value = "根据经纬度返回店铺")
    @PostMapping("/getStoreByLocation")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiStore", value = "位置信息，传经纬度")
    })
    public ResponseResult getStoreByLocation(@RequestBody LuntaiStore luntaiStore) {
        List<LuntaiStore> storeList = luntaiService.getStoreByLocation(luntaiStore);
        return ResponseResult.success(storeList, "查询成功");
    }

    @ApiOperation(value = "通过经纬度获取省市区")
    @PostMapping("/getLocationByCoords")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "coords", value = "经纬度例如118.552631,31.667307"),

    })
    public ResponseResult getLocationByCoords(@RequestParam String coords) throws IOException {
        Map<String, String> location = luntaiService.getLocationByCoords(coords);
        return ResponseResult.success(location, "查询成功");
    }

    @ApiOperation(value = "获取序列号扫码结果")
    @PostMapping("/getQrcodeInfo")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "barcode", value = "序列号"),
    })
    public ResponseResult getQrcodeInfo(@RequestParam String barcode) {
        List<String> location = luntaiService.getQrcodeInfo(barcode);
        return ResponseResult.success(location, "查询成功");
    }

    @ApiOperation(value = "门店审核")
    @PostMapping("/auditStoreApplication")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiStoreApplication", value = "审核信息"),
    })
    public ResponseResult auditStoreApplication(@RequestBody LuntaiStoreApplication application) {
        luntaiService.auditStoreApplication(application);
        return ResponseResult.success(null, "修改成功");
    }

    @ApiOperation(value = "发布轮胎安装请求")
    @PostMapping("/addTyreInstallRequest")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiTyreInstallRequest", value = "LuntaiTyreInstallRequest"),
    })
    public ResponseResult addTyreInstallRequest(@RequestBody LuntaiTyreInstallRequest request) {
        Integer requestId = luntaiService.addTyreInstallRequest(request);
        return ResponseResult.success(requestId, "创建成功");
    }


    @ApiOperation(value = "修改安装轮胎申请")
    @PostMapping("/editTyreInstallRequest")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiTyreInstallRequest", value = "LuntaiTyreInstallRequest"),
    })
    public ResponseResult editTyreInstallRequest(@RequestBody LuntaiTyreInstallRequest request) {
        luntaiService.editTyreInstallRequest(request);
        return ResponseResult.success(null, "创建成功");
    }

    @ApiOperation(value = "安装轮胎")
    @PostMapping("/addTyreInstallRequestTyres")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "List<LuntaiTyreInstallLog>", value = "List<LuntaiTyreInstallLog>"),
    })
    public ResponseResult addTyreInstallRequestTyres(@RequestBody List<LuntaiTyreInstallLog> tyres) {
        luntaiService.addTyreInstallRequestTyres(tyres);
        return ResponseResult.success(null, "安装成功");
    }


    @ApiOperation(value = "（新）根据车辆id查询车轮胎")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "carId", value = "车辆id")
    })
    @PostMapping("/getTyreListByCarId2")
    public ResponseResult getTyreListByCarId2(@RequestParam Integer carId) {
        List<TyreInstallLogDto> tyreList = luntaiService.getTyreListByCarId2(carId);
        return ResponseResult.success(tyreList, "查询成功");
    }


    @ApiOperation(value = "查看所有换胎申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "status", value = "状态")
    })
    @PostMapping("/getTyreInstallRequest")
    public ResponseResult getTyreInstallRequest(@RequestParam Integer status) {
        List<TyreInstallListDto> requestList = luntaiService.getTyreInstallRequest(status);
        return ResponseResult.success(requestList, "查询成功");
    }

    @ApiOperation(value = "查看所有换胎申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "status", value = "状态"),
            @ApiImplicitParam(paramType = "query", name = "pageNum", value = "pageNum"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", value = "pageSize"),
            @ApiImplicitParam(paramType = "query", name = "licensePlate", value = "车牌号")
    })
    @PostMapping("/getTyreInstallRequestOnPage")
    public ResponseResult getTyreInstallRequestOnPage(@RequestParam Integer status, @RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam String licensePlate) {
        ResponsePage<TyreInstallListDto> requestList = luntaiService.getTyreInstallRequestOnPage(status,pageNum,pageSize,licensePlate);
        return ResponseResult.success(requestList, "查询成功");
    }

    @ApiOperation(value = "管理员查看轮胎安装列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "status", value = "状态"),
            @ApiImplicitParam(paramType = "query", name = "licensePlate", value = "车牌号")
    })
    @PostMapping("/getInstallRequestListByLicensePlate")
    public ResponseResult getInstallRequestListByLicensePlate(@RequestParam Integer status, @RequestParam String licensePlate) {
        List<TyreInstallListDto> requestList = luntaiService.getInstallRequestListByLicensePlate(status, licensePlate);
        return ResponseResult.success(requestList, "查询成功");
    }

    @ApiOperation(value = "店铺查询安装轮胎的申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "storeId", value = "店铺id"),
            @ApiImplicitParam(paramType = "query", name = "status", value = "状态"),
    })
    @PostMapping("/getRequestListByStoreId")
    public ResponseResult getRequestListByStoreId(@RequestParam Integer storeId, @RequestParam Integer status) {
        List<TyreInstallListDto> requestList = luntaiService.getRequestListByStoreId(storeId, status);
        return ResponseResult.success(requestList, "查询成功");
    }

//    @ApiOperation(value = "查看所有待安装轮胎的申请")
//    @PostMapping("/getUninstallRequests")
//    public ResponseResult getUninstallRequests() {
//        List<InstallRequestDto> requestList = luntaiService.getUninstallRequests();
//        return ResponseResult.success(requestList, "查询成功");
//    }

    @PostMapping("/sendAuditResult")
    public ResponseResult sendAuditResult(@RequestBody OfaPushVO pushInfo) {
        luntaiService.sendAuditResult(pushInfo);
        return ResponseResult.success(null, "发送成功");
    }

    @PostMapping("/sendAuditResult2")
    public ResponseResult sendAuditResult2(@RequestBody OfaPushVO pushInfo) {
        luntaiService.sendAuditResult2(pushInfo);
        return ResponseResult.success(null, "发送成功");
    }

    @PostMapping("/sendRequireAudit")
    public ResponseResult sendRequireAudit(@RequestBody OfaPushVO pushInfo) {
        luntaiService.sendRequireAudit(pushInfo);
        return ResponseResult.success(null, "发送成功");
    }

    @ApiOperation(value = "申请轮胎理赔")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiClaimsRequest", value = "LuntaiClaimsRequest")
    })
    @PostMapping("/claimsApplication")
    public ResponseResult claimsApplication(@RequestBody LuntaiClaimsRequest request) {
        luntaiService.claimsApplication(request);
        return ResponseResult.success(null, "已发起申请");
    }

    @ApiOperation(value = "查看理赔列表(用户id需要传）")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiClaimsRequest", value = "LuntaiClaimsRequest")
    })
    @PostMapping("/getClaimApplicationList")
    public ResponseResult getClaimApplicationList(@RequestBody ClaimRequestDto request) {
        ResponsePage<ClaimRequestDto> installRequestDtoList = luntaiService.getClaimApplicationList(request);
        return ResponseResult.success(installRequestDtoList, "已查询");
    }

    @ApiOperation(value = "修改理赔申请,如果status为2通过的话，则code必传")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "ClaimRequestDto", value = "ClaimRequestDto")
    })
    @PostMapping("/updateClaimsApplication")
    public ResponseResult updateClaimsApplication(@RequestBody LuntaiClaimsRequest request) {
        luntaiService.updateClaimsApplication(request);
        return ResponseResult.success(null, "已修改");
    }

    @PostMapping("/updateMenu")
    public ResponseResult updateMenu(@RequestBody SysMenu menu) {
        luntaiService.updateMenu(menu);
        return ResponseResult.success(null, "已修改");
    }

    @ApiOperation(value = "通过换胎申请id查看详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "requestId", value = "换胎申请id")
    })
    @PostMapping("/getDetailInfoByClaimId")
    public ResponseResult getDetailInfoByClaimId(@RequestParam Integer requestId) {
        ClaimDetailInfoDto detailInfoDto = luntaiService.getDetailInfoByClaimId(requestId);
        return ResponseResult.success(detailInfoDto, "已查询");
    }

    @ApiOperation(value = "通过安装轮胎申请id查看详情")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "requestId", value = "绑胎申请id")
    })
    @PostMapping("/getInstallTyreInfoByRequestId")
    public ResponseResult getInstallTyreInfoByRequestId(@RequestParam Integer requestId) {
        InstallTyreDetailInfoDto info = luntaiService.getInstallTyreInfoByRequestId(requestId);
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "查询管理员门店信息")
    @PostMapping("/getStoreInfoByAdmin")
    public ResponseResult getStoreInfoByAdmin() {
        LuntaiStoreAdminDto info = luntaiService.getStoreInfoByAdmin();
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "管理员查看门店申请列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "body", name = "LuntaiStoreApplication", value = "LuntaiStoreApplication")
    })
    @PostMapping("/getStoreListByAdmin")
    public ResponseResult getStoreListByAdmin(@RequestBody LuntaiStoreApplication application) {
        ResponsePage<LuntaiStoreApplication> info = luntaiService.getStoreListByAdmin(application);
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "管理员查看门店申请信息")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "applicationId", value = "申请id")
    })
    @PostMapping("/getStoreApplicationById")
    public ResponseResult getStoreApplicationById(@RequestParam Integer applicationId) {
        LuntaiStoreApplicationDto info = luntaiService.getStoreApplicationById(applicationId);
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "查看示例图片")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "type", value = "类型 1.案例照片显示")
    })
    @PostMapping("/getExampleImg")
    public ResponseResult getExampleImg(@RequestParam Integer type) {
        List<LuntaiExampleImage> imgList = luntaiService.getExampleImg(type);
        return ResponseResult.success(imgList, "已查询");
    }

    @ApiOperation(value = "查看审核状态，传type")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "type", value = "1轮胎安装审核  2门店申请审核")
    })
    @PostMapping("/getAuditState")
    public ResponseResult getAuditState(@RequestParam Integer type) {
        Boolean result = luntaiService.getAuditState(type);
        return ResponseResult.success(result, "已查询");
    }

    @ApiOperation(value = "撤回店铺权限，传手机号")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "phone", value = "撤销门店")
    })
    @PostMapping("/withdrawStore")
    public ResponseResult withdrawStore(@RequestParam String phone) {
        return luntaiService.withdrawStore(phone);
    }

    @ApiOperation(value = "删除空申请")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "requestId", value = "请求id")
    })
    @PostMapping("/deleteTyreInstallRequestLog")
    public ResponseResult deleteTyreInstallRequestLog(@RequestParam Integer requestId) {
        luntaiService.deleteTyreInstallRequestLog(requestId);
        return ResponseResult.success(null, "已删除");
    }

    @ApiOperation(value = "上传视频")
    @PostMapping("/uploadVideo")
    public ResponseResult uploadVideo(@RequestParam("file") MultipartFile file) {
        Map<String, String> url = luntaiService.uploadVideo(file);
        return ResponseResult.success(url, "已上传");
    }

    @ApiOperation(value = "查找车辆信息")
    @PostMapping("/getCarInfoByLicensePlate")
    public ResponseResult getCarInfoByLicensePlate(@RequestParam String licensePlate) {
        HashMap<String, Object> car = luntaiService.getCarInfoByLicensePlate(licensePlate);
        return ResponseResult.success(car, "已查询");
    }

    @ApiOperation(value = "店铺四个信息")
    @PostMapping("/storeFourInfo")
    public ResponseResult storeFourInfo() {
        Map<String, Integer> info = luntaiService.storeFourInfo();
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "理赔四个信息")
    @PostMapping("/claimFourInfo")
    public ResponseResult claimFourInfo() {
        Map<String, Integer> info = luntaiService.claimFourInfo();
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "理赔四个信息")
    @PostMapping("/claimFourInfoOnUser")
    public ResponseResult claimFourInfoOnUser(@RequestParam Integer userId) {
        Map<String, Integer> info = luntaiService.claimFourInfoOnUser(userId);
        return ResponseResult.success(info, "已查询");
    }

    @ApiOperation(value = "总共三个信息")
    @PostMapping("/totalThreeInfo")
    public ResponseResult totalThreeInfo() {
        Map<String, Integer> info = luntaiService.totalThreeInfo();
        return ResponseResult.success(info, "已查询");
    }
}
